
a = "()[]"
c = 0
for i in range(0, len(a), 2):
    if a[i] == '(':
        if a[i + 1] == ')':
            c += 1
    elif a[i] == '[':
        if a[i + 1] == ']':
            c += 1
    elif a[i] == '{':
        if a[i + 1] == '}':
            c += 1
    elif a[i] == '<':
        if a[i + 1] == '>':
            c += 1

if len(a) % 2 != 0:
    print("false")
elif c == len(a) // 2:
    print("true")
else:
    print("false")

